package com.example.dao;

import com.example.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserDao {

    @Insert(value = "insert into users value(null, #{name}, #{country}, #{province}, #{cityname}, #{district}, #{date})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int insertUser(User user);

    @Select(value = "select * from users")
    List<User> findListUser();

}
